package com.example.dllo.exe.fenlei.danpin;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.dllo.exe.R;

/**
 * code is far away from bug with the animal protecting
 * <p>
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃永无BUG！  凯哥 祝你一路顺风
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 */
public class DanPinLeftAdapter extends BaseAdapter{
    private Context context;
    private String data[] ={"热门分类","个性配饰","温暖家居","美味厨房","美味礼物","数码小物","创意文具","美容护肤","精致彩妆",
    "运动户外","身体保健","女装","箱包","女鞋","男装","男鞋","母婴"};

    public DanPinLeftAdapter(Context context) {
        this.context = context;
    }

    @Override
    public int getCount() {
        return data.length;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder viewHolder=null;
        LayoutInflater inflater=LayoutInflater.from(context);
        if (view==null){
           view= inflater.inflate(R.layout.danpinleftlayout,null);
            viewHolder=new ViewHolder(view);
            view.setTag(viewHolder);
        }else {
            viewHolder= (ViewHolder) view.getTag();
        }
        viewHolder.danpinlefttextview.setTag(i);
        viewHolder.danpinlefttextview.setText(data[i]);
        return view;
    }
  public  class ViewHolder{
      TextView danpinlefttextview;
      public  ViewHolder(View view){
          danpinlefttextview= (TextView) view.findViewById(R.id.danpinleft_text);
      }
  }
}
